import axios from './axios';
import {
  toast,
  messagebox
} from 'mint-ui';
import qs from 'Qs';

let BASE_URL = process.env.API_HOST;
let BASE_URL2 = process.env.API_HOST2;
// 获取订单小数字
export const orderNum = (data) => {
  return axios.get(BASE_URL + '/Customers/ordernum_list', {
    params: data
  });
}
// 获取订单列表
export const orderList = (data) => {
  return axios.get(BASE_URL + '/Order/pay_list', {
    params: data
  });
}
// 获取订单详情
export const orderDetail = (data) => {
  return axios.get(BASE_URL + '/order/order_detail', {
    params: data
  });
}
// 取消订单
export const delOrder = (data) => {
  return axios.get(BASE_URL + '/Order/order_del', {
    params: data
  });
}
// 确认收货
export const sureOrder = (data) => {
  return axios.get(BASE_URL + '/Order/update_order_status', {
    params: data
  });
}
// 获取提现规则
export const getWithdrawRule = (data) => {
  return axios.get(BASE_URL + '/Customers/Withdraw_Rules', {
    params: data
  });
}

//获取最低提现和用户的总花瓣以及待提现花瓣
export const Withdraw_list = (data) => {
  return axios.get(BASE_URL2 + '/Withdraw/Withdraw_list', {
    params: data
  });
}

//提交提现信息
export const withdraw = (data) => {
  return axios.get(BASE_URL2 + '/Withdraw/insertInfo', {
    params: data
  });
}
//获取用户的银行卡信息
export const getUserData = (data) => {
  return axios.get(BASE_URL + '/Customers/customer_edit', {
    params: data
  });
}

//获取用户的卡余额详情
export const getCardDetail = (data) => {
  return axios.get(BASE_URL + '/Card/cardDetail', {
    params: data
  });
}

//获取地址列表
export const addressList = (data) => {
  return axios.get(BASE_URL + '/Goods/addressList', {
    params: data
  });
}

//添加地址
export const addAddress = (data) => {
  return axios.get(BASE_URL + '/Goods/address', {
    params: data
  });
}

//删除地址
export const delAddress = (data) => {
  return axios.post(BASE_URL + '/Goods/deleteAddress', qs.stringify(data));
}

//消费记录
export const getConsumeList = (data) => {
  return axios.get(BASE_URL + '/Consume/accountDetail', {
    params: data
  });
}

//奖励明细
export const getRewardList = (data) => {
  return axios.get(BASE_URL + '/Customers/share_list', {
    params: data
  });
}

//我的评价
export const getEvaluateList = (data) => {
  return axios.get(BASE_URL + '/order/my_evaluation_list', {
    params: data
  });
}

//保存编辑-评价接口
export const evaluationSave = (data) => {
  return axios.get(BASE_URL + '/order/evaluation_save', {
    params: data
  });
}
//用户个人资料和积分花瓣数量
export const getCustomerData = (data) => {
  return axios.get(BASE_URL + '/Customers/customer_balance', {
    params: data
  });
}

//我的团队
export const getMyTeam = (data) => {
  return axios.get(BASE_URL + '/Customers/son_list', {
    params: data
  });
}

//用户详细个人资料的接口
export const getCustomDetail = (data) => {
  return axios.get(BASE_URL + '/Customers/customer_edit', {
    params: data
  });
}

//保存用户修改的资料
export const changeCustomDetail = (data) => {
  return axios.get(BASE_URL + '/Customers/customer_save', {
    params: data
  });
}

//通过buydata获取订单详情
export const submitOrderdetail = (data) => {
  return axios.get(BASE_URL + '/Order/submit_order_detail', {
    params: data
  });
}

// 积分商城列表
export const integralProjectsList = (data) => {
  return axios.get(BASE_URL + '/min_Intergral/getIntegralProjectsList', {
    params: data
  });
}

// 积分商品详情
export const integralProjectsDetail = (data) => {
  return axios.get(BASE_URL + '/min_Intergral/getIntegralProjectsDetail', {
    params: data
  });
}
// 积分商城 确认兑换
export const integralApply = (data) => {
  return axios.post(BASE_URL + '/min_Intergral/change_apply', qs.stringify(data));
}
// 我的预约列表
export const appointmentOrder = (data) => {
  return axios.get(BASE_URL + '/appointment/appointmentOrder', {
    params: data
  });
}
// 我的拼团列表
export const customerSpelling = (data) => {
  return axios.get(BASE_URL + '/customer_spelling/index', {
    params: data
  });
}
// 服务之星
export const pointScoreList = (data) => {
  return axios.get(BASE_URL + '/Appointment/point_score_list', {
    params: data
  });
}